package cc.comac.mom.api;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import cc.comac.mom.api.base.BaseService;
import cc.comac.mom.config.MultipartSupportConfig;
import io.swagger.annotations.ApiOperation;

@FeignClient(value = "mom-equipment-mgmt-srv", configuration = MultipartSupportConfig.class)
public interface ExcelImportCmd{

    @PostMapping(value = "/p/cs/ExcelImportCmd/importExcel", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    @ApiOperation("Excel导入")
    void importExcel(@RequestPart("file") MultipartFile file, @RequestParam("clz") String clz, @RequestParam("userId") Long userId, @RequestParam("ename") String ename);

    @PostMapping("/p/cs/ExcelImportCmd/downloadTemplate")
    @ApiOperation("导出Excel模板")
    void downloadTemplate(@RequestParam("clz") String clz, @RequestParam("filename") String filename) throws ClassNotFoundException;

//    @PostMapping("/cmd/stationfwd/export")
//    @ApiOperation("通过Excel导出数据")
//    void exportExcel(@RequestParam("clz") String clz, @RequestParam("filename") String filename, @RequestBody SearchCriteria criteria);

}
